using System;
using System.Collections.Generic;
using System.Linq;
using CMPart;
using CSUtils;
using CSUtils.WeProtoCore;
using TripleJump;
//using UnityEngine;
using TripleJumpRoleCfg;
/// <summary>
/// 角色
/// </summary>
namespace TripleJumpRoleCfg {
    /// <summary>
    /// 贸易角色
    /// </summary>
    public partial class CfgTJumpRole : CExcelCfg {
        public string name { get => ""; }

        public MRoleCfgInfo roleInfo { get; private set; }

        public static void InitAll() {
            var arr0 = arr;
            foreach (var cfg in arr0) {
                var roleInfo = new MRoleCfgInfo();
                roleInfo.cfgId = cfg.id;
                roleInfo.eRoleType = cfg.type;
                roleInfo.sizeScale = cfg.roleModelSize;
                roleInfo.isNeedColliderCheck = cfg.isNeedColliderCheck;
                roleInfo.isNeedNavMove = cfg.isNeedNavMove;
                roleInfo.moveSpeed = cfg.moveSpeed;
                roleInfo.roleRadius = cfg.roleRadius;
                roleInfo.artPath = cfg.artPath;
                roleInfo.tag = cfg.tag;
                roleInfo.showName = CL.G(cfg.showNameKey);
                cfg.roleInfo = roleInfo;

                switch (cfg.type) {
                    case ETRoleType.Player:
                        roleInfo._roleType = typeof(TripleJump_FristRoleFly);
                        roleInfo._roleMonoType = typeof(CRoleMono);
                        break;
                    case ETRoleType.Cashier:
                        roleInfo._roleType = typeof(Guest);
                        roleInfo._roleMonoType = typeof(CRoleMono);
                        break;

                    case ETRoleType.Guest:
                        roleInfo._roleType = typeof(Guest);
                        roleInfo._roleMonoType = typeof(CRoleMono);
                        break;
                }

                CRoleManage.Instance.Register(cfg.type, roleInfo);
            }
        }
    }
}
